<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="css/default.css">
    <link rel="stylesheet" type="text/css" href="css/menu.css">
    <link rel="stylesheet" type="text/css" href="css/admin.css">
    <link          rel="icon" type="image/png" href="images/icons/logo.png" />
    <link rel="shortcut icon" type="image/png" href="images/icons/logo.png" />
    <script type="text/javascript" src="scripts/default.js"></script>
    
    <title>Thai Kitchen - Edit Menu</title>
  </head>
  <body>
    <%@include file="header.inc" %>
    <div id="ie6pagecontainer">
      <div id="container">
        <div id="content" style="width: 100%;">
          <h2>Edit Menu Items</h2>
          <table border="1">
            <tr>
              <th>#</th>
              <th>Name</th>
              <th>Description</th>
              <th>Category</th>
              <th>Price</th>
              <th>Tags</th>
              <th>Edit</th>
            </tr>
            <c:forEach var='entry' items='${menuItemsByCategory}'>
              <c:forEach var='menu_item' items='${entry.value}'>
                <tr>
                  <td style="text-align: center;">${menu_item.number}</td>
                  <td>${menu_item.name}</td>
                  <td>${menu_item.description}</td>
                  <td>${entry.key}</td>
                  <fmt:setLocale value="en_US" />
                  <td style="text-align: right;"><fmt:formatNumber type="currency" value="${menu_item.price}" /></td>
                  <td style="text-align: center;">
                    <c:forEach var='tag' items='${menu_item.tags}'>
                      <img src="${tagIcons[tag.name]}" />
                    </c:forEach>
                  </td>
                  <td>
                    <form method="post" action="Edit%20Menu%20Item?id=${menu_item.id}">
                      <button type="submit"><img src="images/icons/pencil.png" alt="Edit" /></button>
                    </form>
                  </td>
                </tr>
              </c:forEach>
            </c:forEach>
          </table>
          <form method="post" action="Add%20Menu%20Item">
            <button type="submit" style="margin: 4px;">
              <img src="images/icons/plus-button.png" alt="Add" /> Add
            </button>
          </form>
        </div>
      </div>
    </div>
    <%@include file="footer.inc" %>
  </body>
</html>